//
//	HotCarList.m
//
//	Create by li cheng on 10/8/2016
//	Copyright © 2016. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "HotCarList.h"

NSString *const kHotCarListFirstletter = @"firstletter";
NSString *const kHotCarListIdField = @"id";
NSString *const kHotCarListImg = @"img";
NSString *const kHotCarListName = @"name";
NSString *const kHotCarListOrdercount = @"ordercount";

@interface HotCarList ()
@end
@implementation HotCarList




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.firstletter != nil){
		dictionary[kHotCarListFirstletter] = self.firstletter;
	}
	dictionary[kHotCarListIdField] = self.idField;
	if(self.img != nil){
		dictionary[kHotCarListImg] = self.img;
	}
	if(self.name != nil){
		dictionary[kHotCarListName] = self.name;
	}
	dictionary[kHotCarListOrdercount] = self.ordercount;
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.firstletter != nil){
		[aCoder encodeObject:self.firstletter forKey:kHotCarListFirstletter];
	}
	[aCoder encodeObject:self.idField forKey:kHotCarListIdField];	if(self.img != nil){
		[aCoder encodeObject:self.img forKey:kHotCarListImg];
	}
	if(self.name != nil){
		[aCoder encodeObject:self.name forKey:kHotCarListName];
	}
	[aCoder encodeObject:self.ordercount forKey:kHotCarListOrdercount];
}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.firstletter = [aDecoder decodeObjectForKey:kHotCarListFirstletter];
	self.idField = [aDecoder decodeObjectForKey:kHotCarListIdField];
	self.img = [aDecoder decodeObjectForKey:kHotCarListImg];
	self.name = [aDecoder decodeObjectForKey:kHotCarListName];
	self.ordercount = [aDecoder decodeObjectForKey:kHotCarListOrdercount]
    ;
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	HotCarList *copy = [HotCarList new];

	copy.firstletter = [self.firstletter copyWithZone:zone];
	copy.idField = self.idField;
	copy.img = [self.img copyWithZone:zone];
	copy.name = [self.name copyWithZone:zone];
	copy.ordercount = self.ordercount;

	return copy;
}
- (void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key{
    
}
@end
